(function(){"use strict";if(!BX||!!BX&&typeof BX.namespace!=="function"||!!BX&&typeof BX.loadExt==="function"){return}BX.namespace("BX");var n="main.bitrix.main.controller.loadext.getextensions";var t="success";var r={};function e(t){return new Promise(function(r){BX.ajax.runAction(n,{data:t}).then(r)})}function i(n){if(n.status!==t){n.errors.map(console.warn);return[]}return n.data.map(function(n){return u(n.extension)||(r[n.extension]=new BX.LoadExt.Extension(n))})}function o(n){return Promise.all(n.map(function(n){return n.load()}))}function u(n){return r[n]}function a(n){return n in r}function c(n){if(BX.type.isArray(n)){return n}if(BX.type.isString(n)){return[n]}return[]}BX.loadExt=function(n){n=c(n);var t=n.every(a);if(t){var r=n.map(u);return o(r)}return e({extension:n}).then(i).then(o)}})();